//
//  KJSRequest.h
//  Kjs
//
//  Created by cfq on 16/5/25.
//  Copyright © 2016年 kjs. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GUATool.h"
#import "UserInfo.h"
#import "IndexItemsModel.h"
#import "ItemByCondModel.h"
#import "ItemDetailModel.h"
#import "UserVirtualAccountModel.h"
#import "InvestRecordModel.h"
#import "InvestItemModel.h"
#import "RaiseRecordModel.h"
#import "RaiseItemModel.h"
#import "FinanceLogModel.h"
#import "BankCardModel.h"
#import "IndexImageModel.h"
#import "IndexItemsModel.h"
#import "InvestItemModel.h"
#import "PayOrderModel.h"
#import "PRealAuthResultModel.h"
#import "ORealAuthResultModel.h"
#import "RegisterModel.h"
#import "ImageUploadModel.h"
#import "MassMessageModel.h"
#import "MassMessageDetailModel.h"
#import "BriefIntroModel.h"
#import "PlatformNewsModel.h"
#import "NewsListModel.h"
//外网
#define Host @"http://58.22.125.84"
//公网
//#define Host @"http://58.22.125.83"
#define ConnectUrl(url) [Host stringByAppendingString:url]

static NSInteger ROW_OF_EACH_PAGE = 5;

@interface KJSRequest : NSObject

/* 用户登录 */
+ (void)LoginWithUsername:(NSString *)username
                 Password:(NSString *)password
                      ret:(void(^)(UserInfo *model))ret;

/*获取首页项目*/
+ (void)GetIndexItemsWithRows:(int)rows
                          ret:(void(^)(IndexItemsModel *model))ret;

/*获取条件查询项目*/
+ (void)GetItemByCondtionWithPage:(int)page
                             Rows:(int)rows
                           Sordid:(NSString *)sordid
                             sord:(NSString *)sord
                           Filter:(NSString *)filter
                              ret:(void (^)(ItemByCondModel *model))ret;
/*获取项目详情*/
+ (void)GetItemDetailWithItemId:(NSString *)itemId
                           page:(int)page
                           rows:(int)rows
                            ret:(void(^)(ItemDetailModel *model))ret;
/*获取用户资产信息*/
+ (void)GetUserAccountAssetsInfoWithPartyId:(NSString *)partyId
                                        ret:(void(^)(UserVirtualAccountModel *model))ret;
/*获取投资记录*/
+ (void)GetUserOrderListWithPartyId:(NSString *)partyId
                      IDisplayStart:(int)startPos
                     IDisplayLength:(int)length
                                ret:(void(^)(InvestRecordModel *model))ret;
/*获取投资项目*/
+ (void)GetUserInvestItemWithPartyId:(NSString *)partyId
                                page:(int)page
                                rows:(int)rows
                          itemStatus:(int)itemStatus
                                 ret:(void(^)(InvestItemModel * model))ret;
/*获取融资记录*/
+ (void)GetRaiseRecordWithPartyId:(NSString *)partyId
                             page:(int)page
                             rows:(int)rows
                              ret:(void(^)(RaiseRecordModel *model))ret;
/*获取融资项目*/
+ (void)GetRaiseItemWithPartyId:(NSString *)partyId
                           page:(int)page
                           rows:(int)rows
                     itemStatus:(int)itemStatus
                            ret:(void(^)(RaiseItemModel *model))ret;

/*获取投资流水*/
+ (void)GetUserInvestLogListWithPartyId:(NSString *)partyId
                                  start:(int)start
                                 length:(int)length
                                    ret:(void(^)(FinanceLogModel *model))ret;
/*获取融资流水*/
+ (void)GetUserRaiseLogListWithPartyId:(NSString *)partyId
                                 start:(int)start
                                length:(int)length
                                   ret:(void(^)(FinanceLogModel *model))ret;
/*获取充值提现流水*/
+ (void)GetUserCashLogListWithPartyId:(NSString *)partyId
                                start:(int)start
                               length:(int)length
                                  ret:(void(^)(FinanceLogModel *model))ret;
/*获取银行卡列表*/
+ (void)GetBankCardListWithPartyId:(NSString *)partyId
                               ret:(void(^)(BankCardModel *model))ret;

/*注册*/
+ (void)RegisterAcceptMessageWithPhoneNumber:(NSString *)phoneNumber
                                 userLoginId:(NSString *)userLoginId
                                    password:(NSString *)password
                            verificationCode:(NSString *)verificationCode
                                         ret:(void(^)(RegisterModel *model))ret;
/*注册发送短信*/
+ (void)RegisterSendMessageWithPhoneNumber:(NSString *)phoneNumber
                                       ret:(void(^)(BasicResult *model))ret;
/*获取首页广告图片*/
+ (void)GetINdexImageWithRet:(void(^)(IndexImageModel *model))ret;
/*提交订单*/
+ (void)PayOrderWithVerificationCode:(NSString *)verificationCodecode
                             partyId:(NSString *)partyId
                              itemId:(NSString *)itemId
                          totalPrice:(NSString *)totalPrice
                            tradePwd:(NSString *)tradePwd
              orderPayModeNamePinYin:(NSString *)orderPayModeNamePinYin
                          bankCardId:(NSString *)bankCardId
                            comments:(NSString *)comments
                                 ret:(void(^)(PayOrderModel *model))ret;
/*提交订单发短信*/
+(void)PayOrderSendMessageWithPhoneNumber:(NSString *)phoneNumber
                                 sendName:(NSString *)sendName
                                      ret:(void(^)(BasicResult *model))ret;
/*解绑我的银行卡*/
+(void)RemoveAppBankCardWithPartyId:(NSString *)partyId
                         bankCardId:(NSString *)bankCardId
                           tradePwd:(NSString *)tradePwd
                                ret:(void(^)(BasicResult *model))ret;
/*添加银行卡*/
+(void)AddBankCardWithPartyId:(NSString *)partyId
             verificationCode:(NSString *)verificationCode
             bankCardNameType:(NSInteger)bankCardNameType
                  bankCardNum:(NSString *)bankCardNum
                bankCardPhone:(NSString *)bankCardPhone
                          ret:(void(^)(BasicResult *model))ret;
/*添加银行卡发短信*/
+(void)AddBankCardSendMessageWithBankCardPhone:(NSString *)bankCardPhone
                                      sendName:(NSString *)sendName
                                           ret:(void(^)(BasicResult *model))ret;
/*实名认证（机构）*/
+(void)OrgRealAuthWithPartyId:(NSString *)partyId
                 oCompanyName:(NSString *)oCompanyName
                         oUan:(NSString *)oUan
               oRepresentName:(NSString *)oRepresentName
              oRepresentPhone:(NSString *)oRepresentPhone
              oRepresentIdNum:(NSString *)oRepresentIdNum
          oRepresentIdNumFile:(NSData *)oRepresentIdNumFile
  oCompanyBusinessLicenseFile:(NSData *)oCompanyBusinessLicenseFile
       oBankPermitLicenseFile:(NSData *)oBankPermitLicenseFile
                          ret:(void(^)(BasicResult *model))ret;
/*实名认证（机构）后台退回重新认证*/
+(void)OrgReRealAuthWithPartyId:(NSString *)partyId
                 oCompanyName:(NSString *)oCompanyName
                         oUan:(NSString *)oUan
               oRepresentName:(NSString *)oRepresentName
              oRepresentPhone:(NSString *)oRepresentPhone
              oRepresentIdNum:(NSString *)oRepresentIdNum
          oRepresentIdNumFile:(NSData *)oRepresentIdNumFile
  oCompanyBusinessLicenseFile:(NSData *)oCompanyBusinessLicenseFile
       oBankPermitLicenseFile:(NSData *)oBankPermitLicenseFile
                          ret:(void(^)(BasicResult *model))ret;
/*实名认证（个人）*/
+(void)PersonRealAuthWithPartyId:(NSString *)partyId
                           pName:(NSString *)pName
                          pIdNum:(NSString *)pIdNum
                             ret:(void(^)(BasicResult *model))ret;
/*实名认证（个人）重新认证*/
+(void)PersonReRealAuthWithPartyId:(NSString *)partyId
                           pName:(NSString *)pName
                          pIdNum:(NSString *)pIdNum
                             ret:(void(^)(BasicResult *model))ret;
/*获取实名认证信息（个人）*/
+(void)GetPRealAuthInfoWithPartyId:(NSString *)partyId
                               ret:(void(^)(PRealAuthResultModel *model))ret;
/*获取实名认证信息（机构）*/
+(void)GetORealAuthInfoWithPartyId:(NSString *)partyId
                               ret:(void(^)(ORealAuthResultModel *model))ret;
/*重置登录密码*/
+(void)updateLoginPswAcceptMessageWithNewPw:(NSString *)newpw
                                phoneNumber:(NSString *)phoneNumber
                           verificationCode:(NSString *)verificationCode
                                        ret:(void(^)(BasicResult *model))ret;
/*重置登录密码发送短信*/
+(void)updateLoginPswSendMessageWithPhoneNumber:(NSString *)phoneNumber
                                            ret:(void(^)(BasicResult *model))ret;
/*绑定手机*/
+(void)BindTelWithUserLoginId:(NSString *)userLoginId
             verificationCode:(NSString *)verificationCode
                          ret:(void(^)(BasicResult *model))ret;
/*绑定手机发送验证码*/
+(void)BindTelSendMessageWithPhoneNumber:(NSString *)phoneNumber
                                     ret:(void(^)(BasicResult *model))ret;
/*修改登录密码*/
+(void)AlterLoginPasswordWithOldPw:(NSString *)oldpw
                             newpw:(NSString *)newpw
                       phoneNumber:(NSString *)phoneNumber
                               ret:(void(^)(BasicResult *model))ret;
/*设置交易密码*/
+(void)SetTradePswWithTradePwd:(NSString *)tradePwd
                       partyId:(NSString *)partyId
                   phoneNumber:(NSString *)phoneNumber
              verificationCode:(NSString *)verificationCode
                           ret:(void(^)(BasicResult *model))ret;
/*设置交易密码发送短信*/
+(void)SetTradePswSendMessageWithPhoneNumber:(NSString *)phoneNumber
                                    sendName:(NSString *)sendname
                                         ret:(void(^)(BasicResult *model))ret;
/*重新设置交易密码*/
+(void)UpdateTradePasswordWithTradePwd:(NSString *)tradePwd
                           oldTradePwd:(NSString *)oldTradePwd
                               partyId:(NSString *)partyId
                                   ret:(void(^)(BasicResult *model))ret;
/*发起融资项目*/
+(void)SubmitItemInfoWithItemStatus:(int)itemStatus
                            partyId:(NSString *)partyId
                        contactName:(NSString *)contactName
                         contactTel:(NSString *)contactTel
                       contactEmail:(NSString *)contactEmail
                      localProvince:(NSString *)localProvince
                          localCity:(NSString *)localCity
                        localCounty:(NSString *)localCounty
                        companyName:(NSString *)companyName
                   teamIntroduction:(NSString *)teamIntroduction
                           itemName:(NSString *)itemName
                gdFinancingRequired:(NSString *)gdFinancingRequired
                   gdSrcOfRepayment:(NSString *)gdSrcOfRepayment
                         gdIfPledge:(int)gdIfPledge
                        targetMoney:(NSString *)targetMoney
            gdAnnualizedBenefitRate:(NSString *)gdAnnualizedBenefitRate
                      gdBenefitMode:(int)gdBenefitMode
                           itemType:(NSString *)itemType
                         gdItemType:(int)gdItemType
                            docList:(NSString *)docList
                                ret:(void(^)(BasicResult *model))ret;
/*融资文件上传*/
+(void)mobileUploadFileWithUploadedFile:(NSData *)uploadedFile
                 _uploadedFile_fileName:(NSString *)_uploadedFile_fileName
                           documentType:(NSString *)documentType
                                    ret:(void(^)(ImageUploadModel *model))ret;
/*融资文件删除*/
+(void)mobileDeleteItemFileWithKjsItemInfoDocumentId:(NSString *)KjsItemInfoDocumentId
                                                 ret:(void(^)(BasicResult *model))ret;
/*提交转账凭证*/
+(void)submitOfflinePaymentVoucherWithPartyId:(NSString *)partyId
                                      orderId:(NSString *)orderid
                                 uploadedFile:(NSData *)uploadedFile
                       _uploadedFile_fileName:(NSString *)_uploadedFile_fileName
                    _uploadedFile_contentType:(NSString *)_uploadedFile_contentType
                               dateResourceId:(NSString *)dateResourceId
                              fileExtensionId:(NSString *)fileExtensionId
                                          ret:(void(^)(BasicResult *model))ret;
/*平台公告列表接口*/
+(void)getAppMassMessageWithPartyId:(NSString *)partyId
                             inPage:(NSInteger)page
                             ofRows:(NSInteger)rows
                                ret:(void(^)(MassMessageModel *model))ret;

/*平台公告详情接口*/
+(void)getAppMassMessageDetailWithUserReceiveMessageId:(NSString *)userReceiveMessageId
                                                   ret:(void(^)(MassMessageDetailModel *model))ret;

/*平台简介、帮助中心、联系我们接口*/
+(void)getPlatformInfoForAppWithSign:(NSString *)sign  //sign 0: 帮助中心, 1: 平台简介, 2: 联系我们
                                 ret:(void(^)(BriefIntroModel *model))ret;

/*平台新闻列表*/
+(void)getNewsListWithPage:(NSString *)page
                      rows:(NSString *)rows
                       ret:(void(^)(PlatformNewsModel *model))ret;
/*平台新闻详情*/
+(void)getNewsDetailWithplatformNewsId:(NSString *)platformNewsId
                                   ret:(void(^)(PlatformNewsModel *model))ret;

/*提交反馈接口*/
+(void)feedbackToAdminWithPartyId:(NSString *)partyId
                          Content:(NSString *)content
                           Source:(NSString *)source
                              ret:(void(^)(BasicResult *model))ret;

/*获取新闻详情*/
+(void)getNewsDetailsForAppWithPlatformNewsId:(NSString *)platformNewsId
                                          ret:(void(^)(NewsListModel *model))ret;
/*获取新闻列表*/
+(void)showNewsListForAppAtPage:(NSString *)page
                           rows:(NSString *)rows
                            ret:(void(^)(NewsListModel *model))ret;
/*获取平台动态详情*/
+(void)getTrendsDetailsForAppWithPlatformTrendsId:(NSString *)platformTrendsId
                                              ret:(void(^)(NewsListModel *model))ret;
/*获取平台动态列表*/
+(void)showTrendsListForAppAtPage:(NSString *)page
                             rows:(NSString *)rows
                              ret:(void(^)(NewsListModel *model))ret;
/*设置银行卡默认主卡*/
+(void)setAppDefaultCardWithPartyId:(NSString *)partyId
                         bankCardId:(NSString *)bankCardId
                                ret:(void(^)(BasicResult *model))ret;
/*验证机构法人发短信*/
+(void)vaildOrgRepresentSendMessageWithPhone:(NSString *)phoneNumber
                                    sendName:(NSString *)sendName
                                         ret:(void(^)(BasicResult *model))ret;
/*验证法人手机号*/
+(void)vaildOrgrepresentWithVerificationCode:(NSString *)verificationCode
                                       PartyId:(NSString *)partyId
                                         ret:(void(^)(BasicResult *model))ret;
@end
